import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/personal',
    children: [
      { path: 'info', component: () => import('@/views/Personal/UserInfoView.vue') },
      { path: 'password', component: () => import('@/views/Personal/PasswordView.vue') }
    ]
  },
  {
    path: '/achievement',
    children: [
      { path: 'project', component: () => import('@/views/Achievement/ProjectView.vue') },
      { path: 'paper', component: () => import('@/views/Achievement/PaperView.vue') },
      { path: 'book', component: () => import('@/views/Achievement/BookView.vue') },
      { path: 'award', component: () => import('@/views/Achievement/AwardView.vue') },
      { path: 'patent', component: () => import('@/views/Achievement/PatentView.vue') },
      { path: 'material', component: () => import('@/views/Achievement/MaterialView.vue') }
    ]
  },
  {
    path: '/student',
    children: [
      { path: 'info', component: () => import('@/views/Student/StudentInfoView.vue') },
      { path: 'award', component: () => import('@/views/Student/StudentAwardView.vue') },
      { path: 'thesis', component: () => import('@/views/Student/StudentThesisView.vue') }
    ]
  },
  {
    path: '/admin',
    children: [
      { path: 'user', component: () => import('@/views/Admin/UserManageView.vue') },
      { path: 'teacher', component: () => import('@/views/Admin/TeacherManageView.vue') },
      { path: 'system', component: () => import('@/views/Admin/SystemMaintainView.vue') }
    ]
  },
  { path: '/', redirect: '/personal/info' }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
